-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: 接入蓝鲸监控APM调用链追踪 #1161 #1283
Conversation
jsonwan
commented
Sep 14, 2022
- 使用纯SDK实现trace追踪,去除javaagent;
- 通过Spring Bean创建线程池,实现子线程trace数据传递;
- 自定义Otel SpanExporter配置,支持通过配置项开关trace上报;
- 支持配置trace采样比率;
- BizCmdbClient部分代码重构。
线程池创建使用Spring Bean
BizCmdbClient线程池创建使用Spring Bean
各处线程池创建使用Spring Bean
去除javaagent相关代码
自定义Otel SpanExporter配置
增加trace上报相关参数配置
QueryAgentStatusClient自动装配设为非强依赖
FlowController自动装配设为非强依赖
FlowController自动装配设为非强依赖
支持设置trace采样比率
支持设置trace采样比率
抽取公共common-otel模块,file-worker支持trace上报
移除javaagent
private void initSpanAndAddRequestId() { | ||
Span currentSpan = tracer.currentSpan(); | ||
if (currentSpan == null) { | ||
currentSpan = tracer.nextSpan().start(); | ||
} | ||
spanInScope = tracer.withSpan(currentSpan); | ||
log.debug("currentSpan={}", currentSpan); | ||
log.debug("MDC={}", getMDCContext()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这里的debug是否有必要
- 如果有必要的话,那么要使用isDebugEnabled判断,因为后面的参数getMDCContext()的调用会克隆一个新的HashMap出来,增加资源消耗
public Map<String, String> getCopyOfContextMap() {
Map<String, String> hashMap = (Map)this.copyOnThreadLocal.get();
return hashMap == null ? null : new HashMap(hashMap);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已删除
|
||
@Autowired | ||
public ScriptCheckServiceImpl(DangerousRuleCache dangerousRuleCache) { | ||
public ScriptCheckServiceImpl(DangerousRuleCache dangerousRuleCache, ExecutorService dangerousRuleCheckExecutor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种ExecutorService类型存在多种的,需要加上@qualifier明确指定会比较好一些。排查下其他地方是否存在类似问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已全部加上